<html>
<head><meta charset="utf-8"><title>rustc_deprecated vs deprecated · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html">rustc_deprecated vs deprecated</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204374430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204374430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204374430">(Jul 19 2020 at 22:57)</a>:</h4>
<p>Is there a reason for this split? It seems like we should perhaps unify these. AFAICT, most of the behavior is the same, though the attributes differ a little on some of the functionality offered. In particular:</p>
<ul>
<li>rustc_deprecated since has special handling for "future" versions, comparing to the release of the Rust compiler being compiled with. We could still handle this by tying it to "crates using staged API" or something like that.</li>
<li>rustc_deprecated permits suggestions; this could be added to deprecated as an unstable feature.</li>
</ul>
<p>AFAICT, these are the only two differences. I think initially we'd probably just alias the two internally rather than trying to deprecate rustc_deprecated, as it is used quite a bit in std and so. We can clean it up in a separate PR.</p>
<p>cc <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> </p>
<p>I'd be happy to propose a PR (or I guess MCP first perhaps, depending on how folks feel).</p>



<a name="204376169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204376169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204376169">(Jul 19 2020 at 23:52)</a>:</h4>
<p>I’m pretty sure normal users would want to have access to suggestions as well, eventually.</p>



<a name="204379544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204379544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204379544">(Jul 20 2020 at 01:40)</a>:</h4>
<p>Yeah - and basically any other feature useful to std, except for tying versioning to the compiler I guess (though even that seems somewhat useful, for some crates).</p>



<a name="204381340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204381340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204381340">(Jul 20 2020 at 02:29)</a>:</h4>
<p>worst case we just have <code>#[rustc_deprecation_suggestions(...)]</code> if we want a top-level attribute to make sure we don't accidentally allow it in stable code</p>



<a name="204386775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204386775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204386775">(Jul 20 2020 at 05:01)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/29935#issuecomment-158307821">this comment</a> was the justification for having two separate attributes</p>



<a name="204391197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204391197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204391197">(Jul 20 2020 at 06:51)</a>:</h4>
<p>The special treatment of future versions was added after I touched that code for the last time.</p>



<a name="204391277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204391277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204391277">(Jul 20 2020 at 06:52)</a>:</h4>
<p>IIRC, the "deprecation inheritance" scheme is the same for both attributes, only the attribute "fields" and their reporting is slightly different, so it should be possible to unify them.</p>



<a name="204413781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204413781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204413781">(Jul 20 2020 at 12:05)</a>:</h4>
<p>It does sound like there's general consensus to unify them, so I'll probably start looking at doing so. <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> -- would you be a good reviewer for that? Is there someone else better?</p>



<a name="204540381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rustc_deprecated%20vs%20deprecated/near/204540381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rustc_deprecated.20vs.20deprecated.html#204540381">(Jul 21 2020 at 12:24)</a>:</h4>
<p>Looks like highfive has already assigned me. I'll review.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>